package vo;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Serialization class for User 
 * @author jaje
 */


@XmlRootElement(name = "user")
public class User implements Serializable {

	transient private static final long serialVersionUID = 1L;

	@XmlAttribute
    public String id;
    
    public String name;
    
    public String password;
    
    
    //Constructor
    public User() {};
    
	public User(String id, String name, String password) {
		super();
		this.id = id;
		this.name = name;
		this.password = password;
	}
	
	public boolean equals(User user) {
		
		if (!user.id.toString().equalsIgnoreCase(this.id)) return false;
		if (!user.name.toString().equals(this.name)) return false;
		if (!user.password.toString().equals(this.password)) return false;
		
		return true;	
	}
	
	public boolean equals(String userId) {
		
		if (!userId.equals(this.id)) return false ;
		else return true;
	}
	
	public String toString() {
		
		return id + " , " + name + " , " + password ;
	}
	
    
}

